<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>JS中的私有属性</title>
</head>
<body>
<script>

  /*
  * JS中的新语法 #和java中的private一样
  *
  * */
  class User {
    #age = 12

    get age(){
      return this.#age
    }

    set age(age){
      this.#age = age
    }
  }
  let user = new  User()
  console.log(user.age);
  user.age =13
  console.log(user.age);


</script>
</body>
</html>